package com.atxiaodei.hellodockercompose.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName HelloController
 * @Deacription TODO
 * @Author 王盟
 * @Date 2021/4/6 18:58
 * @Version 1.0
 **/
@RestController
public class HelloController {

    @Autowired
    StringRedisTemplate redisTemplate;

    @RequestMapping("/hello")
    public String helloCount(){
        Long view = redisTemplate.opsForValue().increment("view");

        return  "使用dockercompose部署java微服务计数器功能，view"+view;
    }
}
